#include < stdio.h >
#include < math.h >
double fun(double x[9]) 
{   int i,j;
	double y=0;
	for(i=0;i<8;i++)   y=y+sqrt((x[i]+x[i+1])/2);
	return y;
} 
int main() 
{ 	double s,a[9]={12.0,34.0,4.0,23.0,34.0,45.0,18.0,3.0,11.0}; 
	int i; 
	printf("\nThe original data is :\n"); 
	for(i=0;i< 9;i++)printf("%6.1f",a[i]); printf("\n\n"); 
	s=fun(a); 
	printf("s=%f\n\n",s); 
return 0;
}
